<template>
  <div class="cate">
    <h4>category - {{ title }}</h4>

    <img
      v-if="title === '美食'"
      src="https://s3.ax1x.com/2021/01/16/srJlq0.jpg"
      alt=""
    />
    <ul v-if="title === '游戏'">
      <li v-for="item in list" :key="item">
        <span>{{ item }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ['title', 'list']
}
</script>

<style lang="less" scoped>
.cate {
  float: left;
  margin: 10px;
  width: 160px;
  height: 300px;
  background-color: skyblue;
}

h4 {
  background-color: #f40;
  padding: 20px;
}

img {
  width: 100%;
}
</style>
